<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>PowerVR SDK</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
<link href="tabs.css" rel="stylesheet" type="text/css">
<table width="100%">
  <tr>
    <td width="33%">
      <p align="left">&nbsp;<a href="http://www.imgtec.com"><img border="0" src="IMGLogo.jpg" width="200" height="30"></a></p>
    </td>
    <td width="33%">
      <p align="center"><font color="#808080" face="Arial" size="2">PowerVR Software Development Kit</a></font></p>
    </td>
    <td width="34%">
      <p align="right"><a href="http://www.powervr.com"><img border="0" src="PVRlogo.jpg" width="200" height="27"></a></p>
    </td>
  </tr>
</table>
<hr>
</head><body>
<!-- Generated by Doxygen 1.3.6 -->
<div class="qindex"><a class="qindex" href="index.html">Main&nbsp;Page</a> | <a class="qindex" href="namespaces.html">Namespace List</a> | <a class="qindex" href="hierarchy.html">Class&nbsp;Hierarchy</a> | <a class="qindex" href="annotated.html">Class&nbsp;List</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="namespacemembers.html">Namespace&nbsp;Members</a> | <a class="qindex" href="functions.html">Class&nbsp;Members</a> | <a class="qindex" href="globals.html">File&nbsp;Members</a></div>
<h1>TextureManager.h</h1><a href="TextureManager_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre>00001 <span class="comment">/******************************************************************************</span>
00002 <span class="comment"></span>
00003 <span class="comment"> @File         TextureManager.h</span>
00004 <span class="comment"></span>
00005 <span class="comment"> @Title        A simple texture manager for use with PVREngine</span>
00006 <span class="comment"></span>
00007 <span class="comment"> @Version      </span>
00008 <span class="comment"></span>
00009 <span class="comment"> @Copyright    Copyright (C)  Imagination Technologies Limited.</span>
00010 <span class="comment"></span>
00011 <span class="comment"> @Platform     Independent - OGL/OGLES/OGLES2 Specific at the moment</span>
00012 <span class="comment"></span>
00013 <span class="comment"> @Description  A class for holding information about textures as they are loaded</span>
00014 <span class="comment">               so that duplicate textures are not kept in memory.</span>
00015 <span class="comment"></span>
00016 <span class="comment">******************************************************************************/</span>
00017 
00018 <span class="preprocessor">#ifndef TEXTUREMANAGER_H</span>
00019 <span class="preprocessor"></span><span class="preprocessor">#define TEXTUREMANAGER_H</span>
00020 <span class="preprocessor"></span>
00021 <span class="comment">/******************************************************************************</span>
00022 <span class="comment">Includes</span>
00023 <span class="comment">******************************************************************************/</span>
00024 
00025 <span class="preprocessor">#include "PVRTools.h"</span>
00026 <span class="preprocessor">#include "PVRTSingleton.h"</span>
00027 <span class="preprocessor">#include "<a class="code" href="dynamicArray_8h.html">dynamicArray.h</a>"</span>
00028 <span class="preprocessor">#include "<a class="code" href="Globals_8h.html">Globals.h</a>"</span>
00029 
00030 <span class="keyword">namespace </span>pvrengine
00031 {
00032 
00033     <span class="keyword">class </span>Texture;
00034     <span class="comment">/*!****************************************************************************</span>
00035 <span class="comment">    Class</span>
00036 <span class="comment">    ******************************************************************************/</span>
00037     <span class="comment">/*!***************************************************************************</span>
00038 <span class="comment">    * @Class TextureManager</span>
00039 <span class="comment">    * @Brief    A simple texture manager for use with PVREngine.</span>
00040 <span class="comment">    * @Description  A simple texture manager for use with PVREngine.</span>
00041 <span class="comment">    *****************************************************************************/</span>
00042     <span class="keyword">class </span>TextureManager
<a name="l00043"></a><a class="code" href="classpvrengine_1_1TextureManager.html">00043</a>     {
00044     <span class="keyword">public</span>:
00045         <span class="comment">/*!***************************************************************************</span>
00046 <span class="comment">        @Function           TextureManager</span>
00047 <span class="comment">        @Description        blank constructor.</span>
00048 <span class="comment">        *****************************************************************************/</span>
00049         <a class="code" href="classpvrengine_1_1TextureManager.html#a0">TextureManager</a>(){}
00050 
<a name="l00051"></a><a class="code" href="classpvrengine_1_1TextureManager.html#a0">00051</a>         <span class="comment">/*!***************************************************************************</span>
00052 <span class="comment">        @Function           ~TextureManager</span>
00053 <span class="comment">        @Description        destructor.</span>
00054 <span class="comment">        *****************************************************************************/</span>
00055         <a class="code" href="classpvrengine_1_1TextureManager.html#a1">~TextureManager</a>();
00056 
00057         <span class="comment">/*!***************************************************************************</span>
00058 <span class="comment">        @Function           TextureManager</span>
00059 <span class="comment">        @Input              i32TotalTextures    initial size of store</span>
00060 <span class="comment">        @Description        blank constructor.</span>
00061 <span class="comment">        *****************************************************************************/</span>
00062         <a class="code" href="classpvrengine_1_1TextureManager.html#a0">TextureManager</a>(<span class="keywordtype">int</span> i32TotalTextures);
00063 
00064         <span class="comment">/*!***************************************************************************</span>
00065 <span class="comment">        @Function           LoadTexture</span>
00066 <span class="comment">        @Input              pszTextureFile  path to pvr texture to load</span>
00067 <span class="comment">        @Return</span>
00068 <span class="comment">        @Description        Adds a texture to the manager checking for duplicates and</span>
00069 <span class="comment">        loading into texture memory.</span>
00070 <span class="comment">        *****************************************************************************/</span>
00071         <a class="code" href="classpvrengine_1_1Texture.html">Texture</a>*    <a class="code" href="classpvrengine_1_1TextureManager.html#a3">LoadTexture</a>(<span class="keyword">const</span> CPVRTString&amp; pszTextureFile);
00072 
00073         <span class="comment">/*!***************************************************************************</span>
00074 <span class="comment">        @Function           GetTexture</span>
00075 <span class="comment">        @Input              u32Texture  handle for texture</span>
00076 <span class="comment">        @Description        Retrieves texture from manager</span>
00077 <span class="comment">        *****************************************************************************/</span>
00078         <a class="code" href="classpvrengine_1_1Texture.html">Texture</a>*    <a class="code" href="classpvrengine_1_1TextureManager.html#a4">GetTexture</a>(<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> u32Texture)<span class="keyword"> const</span>
00079 <span class="keyword">        </span>{
00080             <span class="keywordflow">return</span> m_daTextures[u32Texture];
00081         }
00082 
00083     <span class="keyword">private</span>:
<a name="l00084"></a><a class="code" href="classpvrengine_1_1TextureManager.html#a4">00084</a>         <a class="code" href="classdynamicArray.html">dynamicArray&lt;Texture*&gt;</a> m_daTextures;    
00086         <span class="comment">/*!***************************************************************************</span>
00087 <span class="comment">        @Function           Init</span>
00088 <span class="comment">        @Return             success of initialisation</span>
00089 <span class="comment">        @Description        common initialisation code for constructors etc.</span>
00090 <span class="comment">        *****************************************************************************/</span>
00091         <span class="keywordtype">bool</span> Init();
00092 
00093     };
00094 
00095 }
00096 <span class="preprocessor">#endif // TEXTUREMANAGER_H</span>
00097 <span class="preprocessor"></span>
00098 <span class="comment">/******************************************************************************</span>
00099 <span class="comment">End of file (TextureManager.h)</span>
00100 <span class="comment">******************************************************************************/</span>
00101 
</pre></div><br>
<br>
<P align=left><FONT size=2><STRONG><A 
   href="http://www.imgtec.com/powervr/insider/legal/index.asp">Copyright</A> � 
   1999-2008, Imagination Technologies Ltd.</STRONG></FONT></P>
<hr>
<address style="align: left;"><small><FONT color=f0f>
Generated by <a href="http://www.doxygen.org/index.html">DOXYGEN</a> 1.3.6</small></address>
</body>
</html>
